<!-- 该部门顶级类别损益分析 -->
<template>
  <div class="clas_All">
    <el-table :data="tableData">
      <el-table-column align="center" prop="pname" label="原料类别">
      </el-table-column>
      <el-table-column align="center" label="损益金额/元">
        <el-table-column align="center" prop="prolossCostCurrent" label="本期">
        </el-table-column>
        <el-table-column align="center" prop="prolossCostUpper" label="上期">
        </el-table-column>
      </el-table-column>
      <el-table-column align="center" label="损益率">
        <el-table-column align="center" prop="prolossRateCurrent" label="本期">
        </el-table-column>
        <el-table-column align="center" prop="prolossRateUpper" label="上期">
        </el-table-column>
      </el-table-column>
      <el-table-column label="操作" props="" align="center">
        <template slot-scope="scope">
          <div>
            <el-button size="mini" type="text" @click="GodeptW(scope.row)"
              >该部门子类损益分析</el-button
            >
          </div>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
import { topcatePage } from "@/api/system/cost";
export default {
  props: {
    dataOne: {
      type: Array,
    },
  },
  data() {
    return {
      queryParams: {},
      examineOption: [],
      tableData: [],
    };
  },
  created() {
    this.queryParams.shopCode = this.$route.query.shopCode;
    this.queryParams.pandianCode = this.$route.query.pandianCode;
    this.queryParams.deptCode = this.$route.query.stapType;

    this.getList();
  },
  methods: {
    handleQuery() {},
    getList() {
      topcatePage(this.queryParams).then((res) => {
        if (res.code == 200) {
          this.tableData = res.data;
          this.$forceUpdate();
        }
      });
    },
    GodeptW(v) {
      this.$router.push({
        path: "/ProfitDepartment",
        query: {
          pandianCode: this.queryParams.pandianCode,
          shopCode: this.queryParams.shopCode,
          deptCode: this.queryParams.deptCode,
          stapTypeCode: v.stapType,
        },
      });
    },
  },
};
</script>

<style lang="scss" scoped>
.clas_All {
  margin: 20px;
}
</style>
